﻿using Volo.Abp.Domain;
using Volo.Abp.Modularity;
using EasyAbp.Abp.Trees;
using Joy.Erp.BasicArchives.Core.UniqueCodes;
using Volo.Abp.SettingManagement;
using Volo.Abp.Data;
using Joy.Erp.BasicArchives.ItemMasters;
using Volo.Abp.OpenIddict;

namespace Joy.Erp.BasicArchives;

[DependsOn(
    typeof(AbpDddDomainModule),
    typeof(BasicArchivesDomainSharedModule),
    typeof(AbpSettingManagementDomainModule),
    typeof(AbpTreesDomainModule),
    typeof(AbpOpenIddictDomainModule)
)]
public class BasicArchivesDomainModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<UniqueCodeOptions>(options =>
        {
            options.AddType("FixedSegment", typeof(FixedSegment));
            options.AddType("TimeStampSegment", typeof(TimeStampSegment));
            options.AddType("SerialNumberSegment", typeof(SerialNumberSegment));
        });

        Configure<AbpDataSeedOptions>(options =>
        {
            options.Contributors.Add<UnitDataSeedContributor>();
        });
    }
}
